xend: detect and report qemu-dm failure
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 12 Jun 2008 16:01:31 +0000 (17:01 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 12 Jun 2008 16:01:31 +0000 (17:01 +0100)
commitfb0cba646ee02b354a01c82e5d4e4c155e071266
tree1198d65a826cfc7502113771db1eb7b4f242fbc4
parentaadeb224555dd5c9292e316f7608c4b5daeb8835
xend: detect and report qemu-dm failure

Currently, when qemu-dm fails, typically its exit status is lost and
xend doesn't notice.  In the patch below I use a fifo (named pipe) to
detect qemu-dm's termination and report the exit status to the
logfile, if possible.  (If xend has been restarted since the domain
was created, this isn't possible but we can still know that it failed
and report that fact.)

It would be better to have a failure of qemu crash the domain, by
calling the SCHEDOP_shutdown hypercall with SHUTDOWN_crash.  However
if you have on_crash=restart and the configuration is broken in some
way that causes qemu-dm to bomb out straight away this causes xend to
spin endlessly restarting the doomed domain.  This is a general
problem with on_*=restart and ought to be fixed separately.  When it
is fixed, we can safely arrange for domains whose dm has crashed to be
themselves forcibly crashed.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/python/xen/util/oshelp.py [new file with mode: 0644]
tools/python/xen/util/utils.py [new file with mode: 0644]
tools/python/xen/xend/XendDomain.py
tools/python/xen/xend/XendLogging.py
tools/python/xen/xend/image.py